<!--
 * @Author: hpc(hepch)
 * @Date: 2021-06-15 10:42:55
 * @LastEditors: 杨光辉(GerhardYang)
 * @LastEditTime: 2021-08-09 09:23:16
 * @Description: content
 * @Copyright: 超图软件华中平台客户中心 (SuperMap Software Co., Ltd. -Central China Platform)
-->
<template>
  <div>
    <base-map />
    <map-tools v-show="isShowTools" :key="mapToolsKey" />
  </div>
</template>
<script>
import BaseMap from "./BaseMap.vue";
import MapTools from "./MapTools.vue";
export default {
  data() {
    return {
      mapToolsKey: 0,
    };
  },
  mounted() {
    let self = this;
    this.$eventBus.$on("clearAlldata", function () {
      self.forceRerender();
    });
  },

  components: { BaseMap, MapTools },
  computed: {
    isShowTools() {
      return this.$store.state.isShowTools;
    },
  },
  methods: {
    forceRerender() {
      this.mapToolsKey += 1;
    },
  },
};
</script>

<style></style>
